/*  1:   */ package com.atomikos.icatch.jta;
/*  2:   */ 
/*  3:   */ import java.util.Hashtable;
/*  4:   */ import javax.naming.Context;
/*  5:   */ import javax.naming.Name;
/*  6:   */ import javax.naming.RefAddr;
/*  7:   */ import javax.naming.Reference;
/*  8:   */ import javax.naming.spi.ObjectFactory;
/*  9:   */ 
/* 10:   */ public class RemoteClientUserTransactionFactory
/* 11:   */   implements ObjectFactory
/* 12:   */ {
/* 13:   */   private String url_;
/* 14:   */   
/* 15:   */   public Object getObjectInstance(Object obj, Name name, Context nameCtx, Hashtable environment)
/* 16:   */     throws Exception
/* 17:   */   {
/* 18:58 */     RemoteClientUserTransaction ret = null;
/* 19:60 */     if ((obj == null) || (!(obj instanceof Reference))) {
/* 20:61 */       return null;
/* 21:   */     }
/* 22:63 */     Reference ref = (Reference)obj;
/* 23:64 */     if (!ref.getClassName().equals("com.atomikos.icatch.jta.RemoteClientUserTransaction")) {
/* 24:66 */       return null;
/* 25:   */     }
/* 26:68 */     String jndiName = (String)ref.get("ServerName").getContent();
/* 27:69 */     String url = (String)ref.get("ProviderUrl").getContent();
/* 28:70 */     String initialFactory = (String)ref.get("ContextFactory").getContent();
/* 29:   */     
/* 30:72 */     String timeoutString = (String)ref.get("Timeout").getContent();
/* 31:73 */     int timeout = Integer.parseInt(timeoutString);
/* 32:   */     
/* 33:75 */     ret = new RemoteClientUserTransaction(jndiName, initialFactory, url);
/* 34:76 */     ret.setTransactionTimeout(timeout);
/* 35:77 */     return ret;
/* 36:   */   }
/* 37:   */ }


/* Location:           C:\myfile\mysoft\apache-maven-3.5.0-bin\apache-maven-3.5.0\myrep\com\atomikos\transactions-jta\3.7.0\transactions-jta-3.7.0.jar
 * Qualified Name:     com.atomikos.icatch.jta.RemoteClientUserTransactionFactory
 * JD-Core Version:    0.7.0.1
 */